<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增公告内容')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-post-add">
        <div class="form-group">
            <!--使用select标签，将cms_type数据呈现在这里
                1.add.html页面加载完毕之后，利用ajax从后台查询，利用js将数据呈现在这里
                2.通过控制住请求转到add.html之前，查询cms_type数据，通过循环直接展示数据
            -->
            <!--<input class="form-control" type="text" name="typeName" id="typeName" required>-->
            <label class="col-sm-3 control-label">公告类型：</label>
            <div class="col-sm-8">
                <select class="form-control" name="typeId">
                    <option th:each="cmsType:${vos}" th:value="${cmsType.typeId}">[[${cmsType.typeName}]]</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">内容标题：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="contentTitle" id="contentTitle" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">公告内容：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="contentText" id="contentText" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea id="remark" name="remark" class="form-control"></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "cms/content";

    $("#form-post-add").validate({
        onkeyup: false,
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-post-add').serialize());
        }
    }
</script>
</body>
</html>
